package net.easyjava.tools;

/**
 * Created by wenxiaoning on 15/12/20.
 *
 */
public class test {
    public static void main(String[] args) {
        String str = "w";

        try {

            System.out.println("Integer.valueOf(str) = " + Long.valueOf(str));
        }catch (NumberFormatException e){
            System.out.println("e.getMessage() = " + e.getMessage());
            e.printStackTrace();
        }
    }

    public static void test1(){
        String firefox = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:42.0) Gecko/20100101 Firefox/42.0";
        String safari = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_4) AppleWebKit/600.7.12 (KHTML, like Gecko) Version/8.0.7 Safari/600.7.12";
        String chrome = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.80 Safari/537.36";

        String[] user = firefox.split(" ");
        for (int i = 0; i < user.length; i++) {
            System.out.println("user[i] = " + user[i]);
        }
        System.out.println("===================");
        user = safari.split(" ");
        for (int i = 0; i < user.length; i++) {
            System.out.println("user[i] = " + user[i]);
        }
        System.out.println("===================");
        user = chrome.split(" ");
        for (int i = 0; i < user.length; i++) {
            System.out.println("user[i] = " + user[i]);
        }
    }
}
